SET PROJECTNAME=PSE
SET BRANCH=%1\Source

SET    WORK_CODEVEIL="E:\DSEPROJ\%PROJECTNAME%\UtilBuild\CodeVeil"
SET  SOURCE_CODEVEIL="E:\DSEPROJ\%PROJECTNAME%\Sources\%BRANCH%\Tools\CodeVeil"
SET   WORK_RESOURCES="E:\DSEPROJ\%PROJECTNAME%\UtilBuild\CodeVeil\Resources"
SET SOURCE_RESOURCES="E:\DSEPROJ\%PROJECTNAME%\Sources\%BRANCH%\Framework\Resources"

ECHO Exclui pasta conter projeto do ofuscador (CodeVeil)[%WORK_CODEVEIL%]
if exist %WORK_CODEVEIL% rd %WORK_CODEVEIL% /s /q
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%

ECHO Recria pasta conter arquivos *.* (BAT e CVP - Code Veil Project)[%WORK_CODEVEIL%]
md %WORK_CODEVEIL%
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%

ECHO Copia arquivos *.* (BAT e CVP - Code Veil Project)[xcopy %SOURCE_CODEVEIL%\*.* %WORK_CODEVEIL%]
xcopy %SOURCE_CODEVEIL%\*.* %WORK_CODEVEIL% /Y /I /F /R
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%

ECHO Exclui pasta conter arquivo da chave (*.snk)[%WORK_RESOURCES%]
if exist %WORK_RESOURCES% rd %WORK_RESOURCES% /s /q
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%

ECHO Recria pasta conter arquivo da chave (*.snk)[%WORK_RESOURCES%]
md %WORK_RESOURCES%
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%

ECHO Copia arquivo da chave (*.snk)[xcopy %SOURCE_RESOURCES%\*.snk %WORK_RESOURCES% /Y /I /F /R]
xcopy %SOURCE_RESOURCES%\*.snk %WORK_RESOURCES% /Y /I /F /R
IF %ERRORLEVEL% NEQ 0 EXIT /B %ERRORLEVEL%

rem pause
